<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="org.apache.commons.httpclient.HttpClient" %>
<%@ page import="org.apache.commons.httpclient.UsernamePasswordCredentials" %>
<%@ page import="org.apache.commons.httpclient.methods.GetMethod" %>
<%@ page import="org.apache.commons.httpclient.auth.AuthScope" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="15" />
<title>业务系统应用Tomcat状态监控</title>
</head>
<body>
	<%
		HttpClient client = new HttpClient();
		client.getState().setCredentials(new AuthScope("192.168.10.20", 8080, "Contacts Realm via Digest Authentication"),
				new UsernamePasswordCredentials("admin", "admin"));
		GetMethod get = new GetMethod("http://192.168.10.20:8080/status");
		get.setDoAuthentication(true);
		int status = client.executeMethod(get);
		out.println(status + "\n" + get.getResponseBodyAsString());
	%>
</body>
</html>